#include <Arduino.h>
#include "./device/screen.h"
#include "./device/touch.hpp"
#include <logger.h>
#include <lvgl.h>
#include <demos/lv_demos.h>
void setup() {
  Serial0.begin(115200);
  WireInit();
  screen_init();
  for(int i = 0; i < 20; i++){
    if (touch_scan()) {touch_setup(); break;}
    if (i==19) {logln("Touch panel not found");}
  }
  // lv_obj_t *label = lv_label_create( lv_scr_act() );
  // lv_label_set_text( label, "Hello Ardino and LVGL!");
  // lv_obj_align( label, LV_ALIGN_CENTER, 0, 0 );
  lv_demo_widgets();
  lv_timer_handler(); /* let the GUI do its work */ 
  print_memory_info();
  smooth_on();
}

void loop() {
  // ...existing code...
  // screen_update();
  lv_timer_handler(); /* let the GUI do its work */
  delay( 1 );
}